<!DOCTYPE html>
<html>
<head>
  <title>Canvas fireworks | anime.js</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta property="og:title" content="anime.js">
  <meta property="og:url" content="http://animejs.com">
  <meta property="og:description" content="Javascript Animation Engine">
  <meta property="og:image" content="http://animejs.com/documentation/assets/img/icons/og.png">
  <meta name="twitter:card" content="summary">
  <meta name="twitter:title" content="anime.js">
  <meta name="twitter:site" content="@juliangarnier">
  <meta name="twitter:description" content="Javascript Animation Engine">
  <meta name="twitter:image" content="http://animejs.com/documentation/assets/img/icons/twitter.png">
  <link rel="apple-touch-icon-precomposed" href="../assets/img/icons/apple-touch-icon.png">
  <link rel="icon" type="image/png" href="../assets/img/icons/favicon.png">
  <link href="../assets/css/anime.css" rel="stylesheet">
  <script src="../../anime.js"></script>
</head>
<body>
  <canvas class="fireworks"></canvas>
  <script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
      (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
      m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
    ga('create', 'UA-79927007-1', 'auto');
    ga('send', 'pageview');
  </script>
  <script src="../assets/js/fireworks.js"></script>
  <script>
    window.human = false;
    var centerX = window.innerWidth / 2;
    var centerY = window.innerHeight / 2;

    function autoClick() {
      if (window.human) return;
      fireworks.animateParticules(
        anime.random(centerX-50, centerX+50), 
        anime.random(centerY-50, centerY+50)
      );
      anime({duration: 200}).finished.then(autoClick);
    }

    window.addEventListener('load', function() {
      fireworks.render.play();
      autoClick();
      fireworks.setCanvasSize();
    }, false);
  </script>
  <script src="../assets/js/stats.js"></script>
</body>
</html>
